package com.kob.backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kob.backend.pojo.product;
import com.kob.backend.pojo.shop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShopMapper extends BaseMapper<shop>{
    @Select("select id from shop where shopname=#{shopname}")
    Integer getIdByname(@Param("shopname")String shopname);

    @Select("select product.* from product,sell where #{shopid}=sell.shopid and sell.productid=product.id")
     List<product> getallshopproducts(@Param("shopid")Integer shopid);
}
